// 可能是我的node版本问题，不用严格模式使用ES6语法会报错
"use strict";
const models = require('./data/db');
const express = require('express');
const router = express.Router();
const login = require('./controller/loginController');
const file = require('./controller/fileController');
const img = require('./controller/imgController');
const git = require('./controller/gitController');
/************** 创建(create) 读取(get) 更新(update) 删除(delete) **************/

// 创建账号接口
router.post('/api/login/createAccount',login.createAccount)
// 获取已有账号接口
router.get('/api/login/getAccount', login.getAccount);
//获取文件树
router.get('/api/file/tree', file.getFileTree);
//获取文件内容
router.get('/api/file/content', file.getFileContent);
//新建文件
router.post('/api/file/add', file.addFile);
//保存文件
router.post('/api/file/save', file.saveFile);
//删除文件
router.delete('/api/file/delete', file.deleteFile);


//上传图片
router.post('/api/img/upload',img.uploadImg);


//登陆
router.post('/api/git/login', git.login);
//git commit
router.post('/api/git/commit', git.commit);

//git push
router.post('/api/git/push', git.push);


module.exports = router;
